import { BaseService } from '@/base/base.service'
import { Injectable } from '@nestjs/common'
import { DictItem } from '@prisma/client'
import { DictItemDto } from './dto/dict-item.dto'
import { PrismaBaseService } from '@/prisma-base/prisma-base.service'

@Injectable()
export class DictItemService extends BaseService<DictItem, DictItemDto> {
  constructor(private readonly prismaBase: PrismaBaseService) {
    super('DictItem')
  }

  async getDictItemByMark(dict_mark: string) {
    return await this.prismaBase.dictItem.findMany({
      where: {
        dict: {
          dict_mark,
        },
      },
    })
  }
}
